<template>
	<el-drawer title="详情" v-model="visible" size="500px" destroy-on-close>
		<el-container>
			<el-main class="nopadding">
				<scTable
					ref="table"
					:api-obj="apiObj"
					:params="reqParams"
					:column="column"
					row-key="id"
					hideDo
					hideContextMenu>
					<!-- 固定列-选择列 -->
					<el-table-column label="#" type="index" width="50"></el-table-column>
					<template #status="{ data }">
						<el-tag v-if="data.status == 1">待生产</el-tag>
						<el-tag v-if="data.status == 2">已生产</el-tag>
					</template>
					<template #isReported="{ data }">
						{{ data.isReported ? "是" : "否" }}
					</template>
				</scTable>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	data() {
		return {
			apiObj: this.$API.prodwodetail.pageByWoId,
            reqParams: {
                woId: 0,
            },
			visible: false,
			column: [
				{ prop: "id", label: "id", width: 100, hide: true },
                { prop: 'sN', label: 'SN', width: 160 },
                { prop: 'status', label: '状态', width: 80 },
                { prop: 'isReported', label: '是否已上报', width: 100 },
                { prop: 'reportTime', label: '上报时间', width: 140 },
			],
		};
	},
	methods: {
		open(item) {
			this.reqParams.woId = item.id;
			this.visible = true;
		},
	},
};
</script>
